<?php
namespace Admin\Controller;

class AdController extends CommonController {

    public function _initialize() {
        parent::_initialize();
        $this->info['module_name_zh'] = '广告';
    }

    public function index(){
        $where['type'] = I('type');
        if(I('keywords')) $where['name'] = array('like','%'.I('keywords').'%');
        $dataPage = D(CONTROLLER_NAME)->getPager($where, 10, 'id asc');

        $this->info['list'] = $dataPage['data'];
        $this->info['sum']  = $dataPage['sum'];
        $this->info['page'] = $dataPage['page'];

        $this->assign($this->info);
        $this->display();
    }

}
